home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Draw / Sources / Ruler.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  2.6 KB  |  98 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Ruler.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Laurent Delamare
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef RULER_H
  13. #define RULER_H
  14.  
  15. #ifndef FWSVIEW_H
  16. #include "FWSView.h"
  17. #endif
  18.  
  19. #ifndef FWRUNTYP_H
  20. #include "FWRunTyp.h"
  21. #endif
  22.  
  23. #ifndef FWSTYLE_H
  24. #include "FWStyle.h"
  25. #endif
  26.  
  27. #ifndef FWFONT_H
  28. #include "FWFont.h"
  29. #endif
  30.  
  31. //========================================================================================
  32. //    Forward Class Definitions
  33. //========================================================================================
  34.  
  35. class FW_CFont;
  36. class FW_CFrame;
  37. class FW_CPictureShape;
  38. class FW_CViewContext;
  39.  
  40. //========================================================================================
  41. //    CLASS CRuler
  42. //========================================================================================
  43.  
  44. class CRuler : public FW_CSuperView
  45. {
  46. public:
  47.     FW_DECLARE_CLASS
  48.     FW_DECLARE_AUTO(CRuler)
  49.     
  50. //----------------------------------------------------------------------------------------
  51. //    Initialization/destruction
  52. //
  53. public:
  54.     CRuler(Environment* ev, 
  55.             FW_CSuperView* container, 
  56.             const FW_CRect& bounds, 
  57.             FW_EScrollingDirection scrollDir,
  58.             FW_Fixed zoomFactor);
  59.     virtual ~CRuler();    
  60.  
  61. private:
  62.     CRuler(Environment* ev);
  63.  
  64. //----------------------------------------------------------------------------------------
  65. //    Inherited API
  66. //
  67. public:
  68.     virtual void     Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  69.  
  70.     // ----- Archiving -----
  71.     static void*    Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  72.     static void        Destroy(void* object, FW_ClassTypeConstant type);
  73.     virtual void    Flatten(Environment* ev, FW_CWritableStream& stream) const;
  74.     virtual void    InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  75.     
  76. //----------------------------------------------------------------------------------------
  77. //    New API
  78. //
  79. public:
  80.     void            ZoomFactorChanged(Environment* ev, FW_Fixed zoomFactor);
  81.     
  82. protected:
  83.     void             RenderHorizontalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  84.     void             RenderVerticalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  85.     void            RenderGradation(FW_CViewContext& vc,
  86.                                     short gradation, 
  87.                                     const FW_CPoint& pos);
  88.     
  89. //----------------------------------------------------------------------------------------
  90. //    Data Members
  91. //
  92. private:
  93.     FW_CStyle    fLineStyle;
  94.     FW_CFont    fFont;
  95. };
  96.  
  97. #endif
  98.